package com.xybbs.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xybbs.entity.Users;
import com.xybbs.mapper.UsersMapper;
import com.xybbs.service.UsersService;

@Service
@Transactional
public class UsersServiceImpl implements UsersService {
	@Autowired
	UsersMapper usermapper;
	
	public void signUp(Users user) {
		// TODO Auto-generated method stub
		usermapper.insert(user);
	}
	
	public Users login(String userName,String userPassword) {
		return usermapper.selectUser(userName,userPassword);
	}

	public Users Verify(String userName) {
		// TODO Auto-generated method stub
		return usermapper.selectUserByName(userName);
	}

	public Users getUserInfo(String userId) {
		// TODO Auto-generated method stub
		return usermapper.selectUserById(userId);
	}

	public Users checkUserByNick(String userNick,String userId) {
		// TODO Auto-generated method stub
		return usermapper.selectUserByNick(userNick,userId);
	}

	public void updateUser(String userPassword, String userNick,String userId) {
		// TODO Auto-generated method stub
		usermapper.updateUserById(userPassword, userNick, userId);
	}


}
